package com.pig4cloud.pig.building.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pig4cloud.pig.building.entity.PropertyBuilding;
import com.pig4cloud.pig.building.mapper.BuildingMapper;
import com.pig4cloud.pig.building.service.BuildingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, PropertyBuilding> implements BuildingService{
	@Autowired
	private BuildingMapper buildingMapper;

	@Override
	public IPage<PropertyBuilding> selectAll(Page<PropertyBuilding> page, PropertyBuilding propertyBuilding) {
		// 修改参数传递，从对象中提取 buildingName 字段
		return buildingMapper.selectAll(page,
				propertyBuilding.getBuildingName(),
				propertyBuilding.getCompletionTime());
	}

	@Override
	public PropertyBuilding checkByBuildingName(PropertyBuilding buildingEntity) {
		return buildingMapper.checkByBuildingName(buildingEntity);
	}

}
